package com.jcl.recruit.resume.dao;

import com.jcl.core.db.DatabaseContext;
import com.jcl.recruit.resume.mapper.ResumePersInfoMapper;
import com.jcl.recruit.resume.model.ResumePersInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Component
public class ResumePersInfoDao implements ResumePersInfoMapper {

    @Autowired
    ResumePersInfoMapper resumePersInfoMapper;

    @Override
    public List<ResumePersInfo> findListByResumeIds(String corpCode, List<Integer> resumeIds) {
        DatabaseContext.setCurrentContext();
        return resumePersInfoMapper.findListByResumeIds(corpCode, resumeIds);
    }

    @Override
    public Map<String, Object> findOneMap(String corpCode, Integer resumeId) {
        DatabaseContext.setCurrentContext();
        return resumePersInfoMapper.findOneMap(corpCode, resumeId);
    }

    @Override
    public ResumePersInfo findOne(String corpCode, Integer resumeId) {
        DatabaseContext.setCurrentContext();
        return resumePersInfoMapper.findOne(corpCode, resumeId);
    }

    @Override
    public int add(ResumePersInfo entity) {
        DatabaseContext.setCurrentContext();
        return resumePersInfoMapper.add(entity);
    }

    @Override
    public int updateByPrimaryKey(ResumePersInfo entity) {
        DatabaseContext.setCurrentContext();
        return resumePersInfoMapper.updateByPrimaryKey(entity);
    }

    @Override
    public int batchDeleteByResumeIds(String corpCode, List<Integer> resumeIds) {
        DatabaseContext.setCurrentContext();
        return resumePersInfoMapper.batchDeleteByResumeIds(corpCode, resumeIds);
    }
}
